﻿namespace HRM.CORE.REPORT
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraLayout;
    using DevExpress.XtraLayout.Utils;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using Common.Report;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Windows.Forms; using Common;
    using Dictionary.ERP;

    public class xfmReportRate : XtraForm
    {
        private SimpleButton btCancel;
        private SimpleButton btPrint;
        private ComboBoxEdit cboMonth;
        private ComboBoxEdit cboQuarter;
        private GridColumn colDepartmentName;
        private GridColumn colGroupName;
        private TreeListColumn colName;
        private TreeListColumn colValue;
        private IContainer components;
        private GridLookUpEdit glkBranch;
        private GridLookUpEdit glkDepartment;
        private GridLookUpEdit glkGroup;
        private GridColumn gridColumn1;
        private GridView gridLookUpEdit1View;
        private GridView gridLookUpEdit2View;
        private GridView gridView1;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private DevExpress.Utils.ImageCollection imageCollection1;
        private LayoutControl layoutControl1;
        private LayoutControlGroup layoutControlGroup1;
        private LayoutControlItem layoutControlItem1;
        private LayoutControlItem layoutControlItem2;
        private LayoutControlItem layoutControlItem3;
        private LayoutControlItem layoutControlItem4;
        private LayoutControlItem lcMonth;
        private LayoutControlItem lcQuarter;
        private LayoutControlItem lcYear;
        private string m_Code;
        private int m_Level;
        private int m_Month;
        private int m_Quarter;
        private int m_Value;
        private int m_Year;
        private TimeEdit teYear;
        private TreeList treeList1;
        private TextEdit txtName;

        public xfmReportRate()
        {
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Value = 9;
            this.m_Month = DateTime.Now.Month;
            this.m_Quarter = 1;
            this.m_Year = DateTime.Now.Year;
            this.components = null;
            this.InitializeComponent();
        }

        public xfmReportRate(int Level, string Code)
        {
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Value = 9;
            this.m_Month = DateTime.Now.Month;
            this.m_Quarter = 1;
            this.m_Year = DateTime.Now.Year;
            this.components = null;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.Init();
            this.InitData();
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btPrint_Click(object sender, EventArgs e)
        {
            xfmReport report = new xfmReport();
            switch (this.m_Value)
            {
                case 9:
                {
                    rptReportRate2 xtraReport = new rptReportRate2(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report.SetTitle("Danh S\x00e1ch Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV");
                    report.ShowPrintPreview(xtraReport);
                    break;
                }
                case 10:
                {
                    rptReportRate2 rate2 = new rptReportRate2(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report.SetTitle("Danh S\x00e1ch Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV");
                    report.ShowPrintPreview(rate2);
                    break;
                }
                case 11:
                {
                    rptReportRate3 rate3 = new rptReportRate3(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report.SetTitle("B\x00e1o C\x00e1o Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV");
                    report.ShowPrintPreview(rate3);
                    break;
                }
                case 12:
                {
                    rptReportRate1 rate4 = new rptReportRate1(this.m_Level, this.m_Code, this.m_Month, this.m_Year);
                    report.SetTitle("Bảng TH Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV Theo Th\x00e1ng");
                    report.ShowPrintPreview(rate4);
                    break;
                }
                case 13:
                {
                    rptReportRate4 rate5 = new rptReportRate4(this.m_Level, this.m_Code, this.m_Quarter, this.m_Year);
                    report.SetTitle("Bảng TH Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV Theo Qu\x00fd");
                    report.ShowPrintPreview(rate5);
                    break;
                }
                case 14:
                {
                    rptReportRate5 rate6 = new rptReportRate5(this.m_Level, this.m_Code, this.m_Year);
                    report.SetTitle("Bảng TH Kết Quả Đ\x00e1nh Gi\x00e1 Xếp Loại CB - CNV Theo Năm");
                    report.ShowPrintPreview(rate6);
                    break;
                }
            }
        }

        private void cboMonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.m_Month = this.cboMonth.SelectedIndex + 1;
        }

        private void cboQuarter_SelectedValueChanged(object sender, EventArgs e)
        {
            this.m_Quarter = this.cboQuarter.SelectedIndex + 1;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void glk_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button.Kind == ButtonPredefines.Glyph)
            {
                string name = (sender as GridLookUpEdit).Name;
                if (name != null)
                {
                    if (!(name == "glkBranch"))
                    {
                        if (name == "glkDepartment")
                        {
                            this.glkDepartment.EditValue = null;
                            this.glkGroup.EditValue = null;
                            if (this.glkBranch.EditValue != null)
                            {
                                this.m_Level = 1;
                                this.m_Code = this.glkBranch.EditValue.ToString();
                            }
                            else
                            {
                                this.m_Level = 0;
                                this.m_Code = "";
                            }
                        }
                        else if (name == "glkGroup")
                        {
                            this.glkGroup.EditValue = null;
                            if (this.glkDepartment.EditValue != null)
                            {
                                this.m_Level = 2;
                                this.m_Code = this.glkDepartment.EditValue.ToString();
                            }
                            else if (this.glkBranch.EditValue != null)
                            {
                                this.m_Level = 1;
                                this.m_Code = this.glkBranch.EditValue.ToString();
                            }
                            else
                            {
                                this.m_Level = 0;
                                this.m_Code = "";
                            }
                        }
                    }
                    else
                    {
                        this.glkBranch.EditValue = null;
                        this.glkDepartment.EditValue = null;
                        this.glkGroup.EditValue = null;
                        this.m_Level = 0;
                        this.m_Code = "";
                    }
                }
            }
        }

        private void glkBranch_EditValueChanged(object sender, EventArgs e)
        {
            if (this.glkBranch.EditValue != null)
            {
                this.m_Level = 1;
                this.m_Code = this.glkBranch.EditValue.ToString();
                new HRM_DEPARTMENT().AddGridLookupEdit(this.glkDepartment, this.m_Code);
            }
        }

        private void glkDepartment_EditValueChanged(object sender, EventArgs e)
        {
            if (this.glkDepartment.EditValue != null)
            {
                this.m_Level = 2;
                this.m_Code = this.glkDepartment.EditValue.ToString();
                new HRM_GROUP().AddGridLookupEdit(this.glkGroup, this.glkDepartment.EditValue.ToString());
            }
        }

        private void glkGroup_EditValueChanged(object sender, EventArgs e)
        {
            if (this.glkGroup.EditValue != null)
            {
                this.m_Level = 3;
                this.m_Code = this.glkGroup.EditValue.ToString();
            }
        }

        private void Init()
        {
            this.cboMonth.SelectedIndex = DateTime.Now.Month - 1;
            this.cboQuarter.SelectedIndex = ((this.cboMonth.SelectedIndex + 1) / 3) - 1;
            this.teYear.EditValue = DateTime.Now;
            this.colValue.Visible = false;
            this.colName.OptionsColumn.AllowEdit = false;
            this.colName.OptionsColumn.ReadOnly = true;
            this.treeList1.ExpandAll();
            if (((this.m_Level != 1) && (this.m_Level != 2)) && (this.m_Level == 3))
            {
            }
        }

        private void InitData()
        {
            new HRM_BRANCH().AddGridLookupEdit(this.glkBranch);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmReportRate));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            SerializableAppearanceObject obj3 = new SerializableAppearanceObject();
            SerializableAppearanceObject obj4 = new SerializableAppearanceObject();
            this.btPrint = new SimpleButton();
            this.imageCollection1 = new DevExpress.Utils.ImageCollection(this.components);
            this.btCancel = new SimpleButton();
            this.groupControl1 = new GroupControl();
            this.treeList1 = new TreeList();
            this.colName = new TreeListColumn();
            this.colValue = new TreeListColumn();
            this.groupControl2 = new GroupControl();
            this.layoutControl1 = new LayoutControl();
            this.glkGroup = new GridLookUpEdit();
            this.gridLookUpEdit2View = new GridView();
            this.colGroupName = new GridColumn();
            this.glkDepartment = new GridLookUpEdit();
            this.gridLookUpEdit1View = new GridView();
            this.colDepartmentName = new GridColumn();
            this.teYear = new TimeEdit();
            this.cboMonth = new ComboBoxEdit();
            this.cboQuarter = new ComboBoxEdit();
            this.txtName = new TextEdit();
            this.glkBranch = new GridLookUpEdit();
            this.gridView1 = new GridView();
            this.layoutControlGroup1 = new LayoutControlGroup();
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem4 = new LayoutControlItem();
            this.lcQuarter = new LayoutControlItem();
            this.lcMonth = new LayoutControlItem();
            this.lcYear = new LayoutControlItem();
            this.layoutControlItem2 = new LayoutControlItem();
            this.layoutControlItem3 = new LayoutControlItem();
            this.gridColumn1 = new GridColumn();
            this.imageCollection1.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.treeList1.BeginInit();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.layoutControl1.BeginInit();
            this.layoutControl1.SuspendLayout();
            this.glkGroup.Properties.BeginInit();
            this.gridLookUpEdit2View.BeginInit();
            this.glkDepartment.Properties.BeginInit();
            this.gridLookUpEdit1View.BeginInit();
            this.teYear.Properties.BeginInit();
            this.cboMonth.Properties.BeginInit();
            this.cboQuarter.Properties.BeginInit();
            this.txtName.Properties.BeginInit();
            this.glkBranch.Properties.BeginInit();
            this.gridView1.BeginInit();
            this.layoutControlGroup1.BeginInit();
            this.layoutControlItem1.BeginInit();
            this.layoutControlItem4.BeginInit();
            this.lcQuarter.BeginInit();
            this.lcMonth.BeginInit();
            this.lcYear.BeginInit();
            this.layoutControlItem2.BeginInit();
            this.layoutControlItem3.BeginInit();
            base.SuspendLayout();
            this.btPrint.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btPrint.ImageIndex = 0;
            this.btPrint.ImageList = this.imageCollection1;
            this.btPrint.Location = new Point(0x1c6, 0x11c);
            this.btPrint.Name = "btPrint";
            this.btPrint.Size = new Size(0x5f, 0x18);
            this.btPrint.TabIndex = 2;
            this.btPrint.Text = "Xem trước";
            this.btPrint.Click += new EventHandler(this.btPrint_Click);
            this.imageCollection1.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection1.ImageStream");
            this.imageCollection1.Images.SetKeyName(0, "ico_alpha_Search_16x16.png");
            this.imageCollection1.Images.SetKeyName(1, "ico_alpha_Delete_16x16.png");
            this.imageCollection1.Images.SetKeyName(2, "document2.png");
            this.imageCollection1.Images.SetKeyName(3, "open-16x16.png");
            this.btCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btCancel.ImageIndex = 1;
            this.btCancel.ImageList = this.imageCollection1;
            this.btCancel.Location = new Point(0x22f, 0x11c);
            this.btCancel.Name = "btCancel";
            this.btCancel.Size = new Size(0x5f, 0x18);
            this.btCancel.TabIndex = 3;
            this.btCancel.Text = "Tho\x00e1t";
            this.btCancel.Click += new EventHandler(this.btCancel_Click);
            this.groupControl1.Controls.Add(this.treeList1);
            this.groupControl1.Location = new Point(6, 5);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x173, 0x108);
            this.groupControl1.TabIndex = 4;
            this.groupControl1.Text = "Loại b\x00e1o c\x00e1o";
            this.treeList1.Appearance.FocusedCell.BackColor = Color.Orange;
            this.treeList1.Appearance.FocusedCell.BackColor2 = Color.White;
            this.treeList1.Appearance.FocusedCell.GradientMode = LinearGradientMode.BackwardDiagonal;
            this.treeList1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.treeList1.BorderStyle = BorderStyles.NoBorder;
            this.treeList1.Columns.AddRange(new TreeListColumn[] { this.colName, this.colValue });
            this.treeList1.Dock = DockStyle.Fill;
            this.treeList1.Location = new Point(2, 0x16);
            this.treeList1.Name = "treeList1";
            this.treeList1.BeginUnboundLoad();
            this.treeList1.AppendNode(new object[] { "Đ\x00e1nh gi\x00e1, xếp loại nh\x00e2n vi\x00ean", "9" }, -1, 3, 3, -1);
            this.treeList1.AppendNode(new object[] { "Danh s\x00e1ch đ\x00e1nh gi\x00e1 xếp loại CB - CNV", "10" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "B\x00e1o c\x00e1o kết quả đ\x00e1nh gi\x00e1 xếp loại CB - CNV", "11" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Bảng TH kết quả đ\x00e1nh gi\x00e1, xếp loại CB - CNV theo th\x00e1ng", "12" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Bảng TH kết quả đ\x00e1nh gi\x00e1, xếp loại CB - CNV theo qu\x00fd", "13" }, 0, 2, 2, -1);
            this.treeList1.AppendNode(new object[] { "Bảng TH kết quả đ\x00e1nh gi\x00e1, xếp loại CB - CNV theo năm", "14" }, 0, 2, 2, -1);
            this.treeList1.EndUnboundLoad();
            this.treeList1.OptionsBehavior.PopulateServiceColumns = true;
            this.treeList1.OptionsView.ShowColumns = false;
            this.treeList1.OptionsView.ShowHorzLines = false;
            this.treeList1.OptionsView.ShowIndicator = false;
            this.treeList1.OptionsView.ShowVertLines = false;
            this.treeList1.SelectImageList = this.imageCollection1;
            this.treeList1.Size = new Size(0x16f, 240);
            this.treeList1.TabIndex = 2;
            this.treeList1.FocusedNodeChanged += new FocusedNodeChangedEventHandler(this.treeList1_FocusedNodeChanged);
            this.colName.Caption = "T\x00ean b\x00e1o c\x00e1o";
            this.colName.FieldName = "Name";
            this.colName.MinWidth = 0x37;
            this.colName.Name = "colName";
            this.colName.Visible = true;
            this.colName.VisibleIndex = 0;
            this.colValue.Caption = "Gi\x00e1 trị";
            this.colValue.FieldName = "Value";
            this.colValue.Name = "colValue";
            this.colValue.Visible = true;
            this.colValue.VisibleIndex = 1;
            this.groupControl2.Controls.Add(this.layoutControl1);
            this.groupControl2.Location = new Point(0x17f, 5);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0x112, 0x108);
            this.groupControl2.TabIndex = 6;
            this.groupControl2.Text = "C\x00e1c tham số";
            this.layoutControl1.Controls.Add(this.glkGroup);
            this.layoutControl1.Controls.Add(this.glkDepartment);
            this.layoutControl1.Controls.Add(this.teYear);
            this.layoutControl1.Controls.Add(this.cboMonth);
            this.layoutControl1.Controls.Add(this.cboQuarter);
            this.layoutControl1.Controls.Add(this.txtName);
            this.layoutControl1.Controls.Add(this.glkBranch);
            this.layoutControl1.Dock = DockStyle.Fill;
            this.layoutControl1.Location = new Point(2, 0x16);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new Size(270, 240);
            this.layoutControl1.TabIndex = 30;
            this.layoutControl1.Text = "layoutControl1";
            this.glkGroup.Location = new Point(0x5b, 70);
            this.glkGroup.Name = "glkGroup";
            this.glkGroup.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.glkGroup.Properties.Appearance.Options.UseFont = true;
            this.glkGroup.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkGroup.Properties.Buttons"), new KeyShortcut(Keys.None), appearance, "", null, null, true) });
            this.glkGroup.Properties.NullText = "[Chọn tổ nh\x00f3m]";
            this.glkGroup.Properties.View = this.gridLookUpEdit2View;
            this.glkGroup.Size = new Size(0xa7, 0x16);
            this.glkGroup.StyleController = this.layoutControl1;
            this.glkGroup.TabIndex = 0x22;
            this.glkGroup.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.glkGroup.EditValueChanged += new EventHandler(this.glkGroup_EditValueChanged);
            this.gridLookUpEdit2View.Columns.AddRange(new GridColumn[] { this.colGroupName });
            this.gridLookUpEdit2View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit2View.Name = "gridLookUpEdit2View";
            this.gridLookUpEdit2View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit2View.OptionsView.ShowGroupPanel = false;
            this.colGroupName.Caption = "T\x00ean tổ nh\x00f3m";
            this.colGroupName.FieldName = "GroupName";
            this.colGroupName.Name = "colGroupName";
            this.colGroupName.Visible = true;
            this.colGroupName.VisibleIndex = 0;
            this.glkDepartment.Location = new Point(0x5b, 0x29);
            this.glkDepartment.Name = "glkDepartment";
            this.glkDepartment.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.glkDepartment.Properties.Appearance.Options.UseFont = true;
            this.glkDepartment.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkDepartment.Properties.Buttons"), new KeyShortcut(Keys.None), obj3, "", null, null, true) });
            this.glkDepartment.Properties.NullText = "[Chọn ph\x00f2ng ban]";
            this.glkDepartment.Properties.View = this.gridLookUpEdit1View;
            this.glkDepartment.Size = new Size(0xa7, 0x16);
            this.glkDepartment.StyleController = this.layoutControl1;
            this.glkDepartment.TabIndex = 0x21;
            this.glkDepartment.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.glkDepartment.EditValueChanged += new EventHandler(this.glkDepartment_EditValueChanged);
            this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.colDepartmentName });
            this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit1View.Name = "gridLookUpEdit1View";
            this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.colDepartmentName.Caption = "T\x00ean ph\x00f2ng ban";
            this.colDepartmentName.FieldName = "DepartmentName";
            this.colDepartmentName.Name = "colDepartmentName";
            this.colDepartmentName.Visible = true;
            this.colDepartmentName.VisibleIndex = 0;
            this.teYear.EditValue = new DateTime(0x7dc, 7, 0x12, 0, 0, 0, 0);
            this.teYear.Location = new Point(0x5b, 0xb9);
            this.teYear.Name = "teYear";
            this.teYear.Properties.Appearance.Options.UseTextOptions = true;
            this.teYear.Properties.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
            this.teYear.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.teYear.Properties.Mask.EditMask = "yyyy";
            this.teYear.Size = new Size(0xa7, 20);
            this.teYear.StyleController = this.layoutControl1;
            this.teYear.TabIndex = 0x20;
            this.teYear.EditValueChanging += new ChangingEventHandler(this.teYear_EditValueChanging);
            this.cboMonth.Location = new Point(0x5b, 0x81);
            this.cboMonth.Name = "cboMonth";
            this.cboMonth.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboMonth.Properties.Items.AddRange(new object[] { "Th\x00e1ng 1", "Th\x00e1ng 2", "Th\x00e1ng 3", "Th\x00e1ng 4", "Th\x00e1ng 5", "Th\x00e1ng 6", "Th\x00e1ng 7", "Th\x00e1ng 8", "Th\x00e1ng 9", "Th\x00e1ng 10", "Th\x00e1ng 11", "Th\x00e1ng 12" });
            this.cboMonth.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.cboMonth.Size = new Size(0xa7, 20);
            this.cboMonth.StyleController = this.layoutControl1;
            this.cboMonth.TabIndex = 0x1f;
            this.cboMonth.SelectedIndexChanged += new EventHandler(this.cboMonth_SelectedIndexChanged);
            this.cboQuarter.Location = new Point(0x5b, 0x9d);
            this.cboQuarter.Name = "cboQuarter";
            this.cboQuarter.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboQuarter.Properties.Items.AddRange(new object[] { "Qu\x00fd I", "Qu\x00fd II", "Qu\x00fd III", "Qu\x00fd IV" });
            this.cboQuarter.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.cboQuarter.Size = new Size(0xa7, 20);
            this.cboQuarter.StyleController = this.layoutControl1;
            this.cboQuarter.TabIndex = 30;
            this.cboQuarter.SelectedValueChanged += new EventHandler(this.cboQuarter_SelectedValueChanged);
            this.txtName.EditValue = "[T\x00ean nh\x00e2n vi\x00ean]";
            this.txtName.Location = new Point(0x5b, 0x65);
            this.txtName.Name = "txtName";
            this.txtName.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.txtName.Properties.Appearance.Options.UseFont = true;
            this.txtName.Properties.ReadOnly = true;
            this.txtName.Size = new Size(0xa7, 20);
            this.txtName.StyleController = this.layoutControl1;
            this.txtName.TabIndex = 0x1b;
            this.glkBranch.Location = new Point(0x5b, 12);
            this.glkBranch.Name = "glkBranch";
            this.glkBranch.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.glkBranch.Properties.Appearance.Options.UseFont = true;
            this.glkBranch.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkBranch.Properties.Buttons"), new KeyShortcut(Keys.None), obj4, "", null, null, true) });
            this.glkBranch.Properties.NullText = "[T\x00ean chi nh\x00e1nh]";
            this.glkBranch.Properties.PopupSizeable = false;
            this.glkBranch.Properties.TextEditStyle = TextEditStyles.Standard;
            this.glkBranch.Properties.View = this.gridView1;
            this.glkBranch.Properties.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.glkBranch.Size = new Size(0xa7, 0x16);
            this.glkBranch.StyleController = this.layoutControl1;
            this.glkBranch.TabIndex = 20;
            this.glkBranch.TabStop = false;
            this.glkBranch.EditValueChanged += new EventHandler(this.glkBranch_EditValueChanged);
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridColumn1 });
            this.gridView1.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem4, this.lcQuarter, this.lcMonth, this.lcYear, this.layoutControlItem2, this.layoutControlItem3 });
            this.layoutControlGroup1.Location = new Point(0, 0);
            this.layoutControlGroup1.Name = "layoutControlGroup1";
            this.layoutControlGroup1.Size = new Size(270, 240);
            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Text = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            this.layoutControlItem1.Control = this.glkBranch;
            this.layoutControlItem1.CustomizationFormText = "Chi nh\x00e1nh:";
            this.layoutControlItem1.Location = new Point(0, 0);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new Size(250, 0x1a);
            this.layoutControlItem1.Text = "Chi nh\x00e1nh:";
            this.layoutControlItem1.TextSize = new Size(0x4b, 13);
            this.layoutControlItem4.Control = this.txtName;
            this.layoutControlItem4.CustomizationFormText = "T\x00ean nh\x00e2n vi\x00ean:";
            this.layoutControlItem4.Location = new Point(0, 0x54);
            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.Size = new Size(250, 0x1d);
            this.layoutControlItem4.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 5, 0);
            this.layoutControlItem4.Text = "T\x00ean nh\x00e2n vi\x00ean:";
            this.layoutControlItem4.TextSize = new Size(0x4b, 13);
            this.layoutControlItem4.Visibility = LayoutVisibility.Never;
            this.lcQuarter.Control = this.cboQuarter;
            this.lcQuarter.CustomizationFormText = "Qu\x00fd b\x00e1o c\x00e1o:";
            this.lcQuarter.Location = new Point(0, 0x8d);
            this.lcQuarter.Name = "lcQuarter";
            this.lcQuarter.Size = new Size(250, 0x1c);
            this.lcQuarter.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 4, 0);
            this.lcQuarter.Text = "Qu\x00fd b\x00e1o c\x00e1o:";
            this.lcQuarter.TextSize = new Size(0x4b, 13);
            this.lcQuarter.Visibility = LayoutVisibility.Never;
            this.lcMonth.Control = this.cboMonth;
            this.lcMonth.CustomizationFormText = "Th\x00e1ng b\x00e1o c\x00e1o:";
            this.lcMonth.Location = new Point(0, 0x71);
            this.lcMonth.Name = "lcMonth";
            this.lcMonth.Size = new Size(250, 0x1c);
            this.lcMonth.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 4, 0);
            this.lcMonth.Text = "Th\x00e1ng b\x00e1o c\x00e1o:";
            this.lcMonth.TextSize = new Size(0x4b, 13);
            this.lcYear.Control = this.teYear;
            this.lcYear.CustomizationFormText = "Năm b\x00e1o c\x00e1o:";
            this.lcYear.Location = new Point(0, 0xa9);
            this.lcYear.Name = "lcYear";
            this.lcYear.Size = new Size(250, 0x33);
            this.lcYear.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 4, 0);
            this.lcYear.Text = "Năm b\x00e1o c\x00e1o:";
            this.lcYear.TextSize = new Size(0x4b, 13);
            this.layoutControlItem2.Control = this.glkDepartment;
            this.layoutControlItem2.CustomizationFormText = "Ph\x00f2ng ban:";
            this.layoutControlItem2.Location = new Point(0, 0x1a);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
            this.layoutControlItem2.Size = new Size(250, 0x1d);
            this.layoutControlItem2.Text = "Ph\x00f2ng ban:";
            this.layoutControlItem2.TextSize = new Size(0x4b, 13);
            this.layoutControlItem3.Control = this.glkGroup;
            this.layoutControlItem3.CustomizationFormText = "Tổ nh\x00f3m:";
            this.layoutControlItem3.Location = new Point(0, 0x37);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
            this.layoutControlItem3.Size = new Size(250, 0x1d);
            this.layoutControlItem3.Text = "Tổ nh\x00f3m:";
            this.layoutControlItem3.TextSize = new Size(0x4b, 13);
            this.gridColumn1.Caption = "T\x00ean chi nh\x00e1nh";
            this.gridColumn1.FieldName = "BranchName";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x298, 0x13d);
            base.Controls.Add(this.groupControl2);
            base.Controls.Add(this.groupControl1);
            base.Controls.Add(this.btCancel);
            base.Controls.Add(this.btPrint);
            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmReportRate";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "T\x00f9y Chọn In";
            this.imageCollection1.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.treeList1.EndInit();
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.layoutControl1.EndInit();
            this.layoutControl1.ResumeLayout(false);
            this.glkGroup.Properties.EndInit();
            this.gridLookUpEdit2View.EndInit();
            this.glkDepartment.Properties.EndInit();
            this.gridLookUpEdit1View.EndInit();
            this.teYear.Properties.EndInit();
            this.cboMonth.Properties.EndInit();
            this.cboQuarter.Properties.EndInit();
            this.txtName.Properties.EndInit();
            this.glkBranch.Properties.EndInit();
            this.gridView1.EndInit();
            this.layoutControlGroup1.EndInit();
            this.layoutControlItem1.EndInit();
            this.layoutControlItem4.EndInit();
            this.lcQuarter.EndInit();
            this.lcMonth.EndInit();
            this.lcYear.EndInit();
            this.layoutControlItem2.EndInit();
            this.layoutControlItem3.EndInit();
            base.ResumeLayout(false);
        }

        private void teYear_EditValueChanging(object sender, ChangingEventArgs e)
        {
            try
            {
                this.m_Year = Convert.ToDateTime(e.NewValue.ToString()).Year;
            }
            catch
            {
            }
        }

        private void treeList1_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e)
        {
            try
            {
                this.m_Value = Convert.ToInt32(e.Node.GetValue(this.colValue).ToString());
                if ((((this.m_Value == 0) || (this.m_Value == 1)) || ((this.m_Value == 8) || (this.m_Value == 2))) || (this.m_Value == 3))
                {
                    this.lcMonth.Visibility = LayoutVisibility.Never;
                    this.lcQuarter.Visibility = LayoutVisibility.Never;
                    this.lcYear.Visibility = LayoutVisibility.Never;
                }
                else if (((((this.m_Value == 9) || (this.m_Value == 10)) || ((this.m_Value == 11) || (this.m_Value == 12))) || (this.m_Value == 4)) || (this.m_Value == 6))
                {
                    this.lcMonth.Visibility = LayoutVisibility.Always;
                    this.lcQuarter.Visibility = LayoutVisibility.Never;
                    this.lcYear.Visibility = LayoutVisibility.Always;
                }
                else if (((this.m_Value == 5) || (this.m_Value == 7)) || (this.m_Value == 14))
                {
                    this.lcMonth.Visibility = LayoutVisibility.Never;
                    this.lcQuarter.Visibility = LayoutVisibility.Never;
                    this.lcYear.Visibility = LayoutVisibility.Always;
                }
                else
                {
                    this.lcMonth.Visibility = LayoutVisibility.Always;
                    this.lcQuarter.Visibility = LayoutVisibility.Always;
                    this.lcYear.Visibility = LayoutVisibility.Always;
                }
            }
            catch
            {
            }
        }
    }
}

